# -*- coding: utf-8 -*-

# File Name： tmp
# Description :
# Author : lirui
# create_date： 2022/9/6
# Change Activity:
from ml.network.ip_utility.ip_re import is_ipv4, get_ipv4_str, get_ipv6_str

info = """116.249.139.200:9701 A mapss.dbank.fudian-bank.com_CMCC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_mpaas_9701_ctc 0 0 0
116.249.139.200:9701 A mapss.dbank.fudian-bank.com_CTC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_mpaas_9701_ctc 0 0 0
116.249.139.204:443 A web.dbank.fudian-bank.com_CTC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_web_443_ctc 0 0 0
116.249.139.204:443 A web.dbank.fudian-bank.com_CMCC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_web_443_ctc 0 0 0
116.249.139.205:443 A open.dbank.fudian-bank.com_CTC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_open_443_ctc 0 0 0
116.249.139.205:443 A open.dbank.fudian-bank.com_CMCC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_open_443_ctc 0 0 0
116.249.139.206:443 A mall.dbank.fudian-bank.com_CMCC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_mall_443_ctc 0 0 0
116.249.139.206:443 A mall.dbank.fudian-bank.com_CTC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_mall_443_ctc 0 0 0
116.249.139.207:443 A mallportal.dbank.fudian-bank.com_CTC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_mallportal_443_ctc 0 0 0
116.249.139.207:443 A mallportal.dbank.fudian-bank.com_CMCC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_mallportal_443_ctc 0 0 0
116.249.139.208:443 A lmapi.dbank.fudian-bank.com_CTC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_lmapi_443_ctc 0 0 0
116.249.139.208:443 A lmapi.dbank.fudian-bank.com_CMCC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_lmapi_443_ctc 0 0 0
116.249.139.209:443 A cmw.dbank.fudian-bank.com_cmcc FD-YNCG-Ebank-SLB.COM /Common/cg_vs_cmw_443_ctc 0 0 0
116.249.139.209:443 A cmw.dbank.fudian-bank.com_ctc FD-YNCG-Ebank-SLB.COM /Common/cg_vs_cmw_443_ctc 0 0 0
116.249.139.210:443 A maplw.dbank.fudian-bank.com_CMCC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_maplw_443_ctc 0 0 0
116.249.139.210:443 A maplw.dbank.fudian-bank.com_CTC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_maplw_443_ctc 0 0 0
116.249.139.211:443 A fdxiaomi.dbank.fudian-bank.com_cmcc FD-YNCG-Ebank-SLB.COM /Common/cg_vs_fdxiaomi_443_ctc 0 0 0
116.249.139.211:443 A fdxiaomi.dbank.fudian-bank.com_ctc FD-YNCG-Ebank-SLB.COM /Common/cg_vs_fdxiaomi_443_ctc 0 0 0
116.249.139.212:443 A ecashregister.dbank.fudian-bank.com_CMCC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_ecashregister_443_ctc 0 0 0
116.249.139.212:443 A ecashregister.dbank.fudian-bank.com_CTC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_ecashregister_443_ctc 0 0 0
116.249.139.213:443 A openabt.dbank.fudian-bank.com_cmcc FD-YNCG-Ebank-SLB.COM /Common/cg_vs_openabt_443_ctc 0 0 0
116.249.139.213:443 A openabt.dbank.fudian-bank.com_ctc FD-YNCG-Ebank-SLB.COM /Common/cg_vs_openabt_443_ctc 0 0 0
116.249.139.213:10443 A openapiabt.dbank.fudian-bank.com_CTC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_openapiabt_10443_ctc 0 0 0
116.249.139.213:10443 A openapiabt.dbank.fudian-bank.com_CMCC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_openapiabt_10443_ctc 0 0 0
116.249.139.214:443 A maplwabt.dbank.fudian-bank.com_CMCC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_maplwabt_443_ctc 0 0 0
116.249.139.214:443 A maplwabt.dbank.fudian-bank.com_CTC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_maplwabt_443_ctc 0 0 0
218.206.50.40:9701 A mapss.dbank.fudian-bank.com_CMCC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_mpaas_9701_cmcc 0 0 0
218.206.50.40:9701 A mapss.dbank.fudian-bank.com_CTC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_mpaas_9701_cmcc 0 0 0
218.206.50.44:443 A web.dbank.fudian-bank.com_CTC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_web_443_cmcc 0 0 0
218.206.50.44:443 A web.dbank.fudian-bank.com_CMCC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_web_443_cmcc 0 0 0
218.206.50.45:443 A open.dbank.fudian-bank.com_CMCC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_open_443_cmcc 0 0 0
218.206.50.45:443 A open.dbank.fudian-bank.com_CTC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_open_443_cmcc 0 0 0
218.206.50.46:443 A mall.dbank.fudian-bank.com_CMCC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_mall_443_cmcc 0 0 0
218.206.50.46:443 A mall.dbank.fudian-bank.com_CTC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_mall_443_cmcc 0 0 0
218.206.50.47:443 A mallportal.dbank.fudian-bank.com_CMCC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_mallportal_443_cmcc 0 0 0
218.206.50.47:443 A mallportal.dbank.fudian-bank.com_CTC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_mallportal_443_cmcc 0 0 0
218.206.50.48:443 A lmapi.dbank.fudian-bank.com_CTC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_lmapi_443_cmcc 0 0 0
218.206.50.48:443 A lmapi.dbank.fudian-bank.com_CMCC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_lmapi_443_cmcc 0 0 0
218.206.50.49:443 A cmw.dbank.fudian-bank.com_ctc FD-YNCG-Ebank-SLB.COM /Common/cg_vs_cmw_443_cmcc 0 0 0
218.206.50.49:443 A cmw.dbank.fudian-bank.com_cmcc FD-YNCG-Ebank-SLB.COM /Common/cg_vs_cmw_443_cmcc 0 0 0
218.206.50.50:443 A maplw.dbank.fudian-bank.com_CMCC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_maplw_443_cmcc 0 0 0
218.206.50.50:443 A maplw.dbank.fudian-bank.com_CTC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_maplw_443_cmcc 0 0 0
218.206.50.51:443 A fdxiaomi.dbank.fudian-bank.com_cmcc FD-YNCG-Ebank-SLB.COM /Common/cg_vs_fdxiaomi_443_cmcc 0 0 0
218.206.50.51:443 A fdxiaomi.dbank.fudian-bank.com_ctc FD-YNCG-Ebank-SLB.COM /Common/cg_vs_fdxiaomi_443_cmcc 0 0 0
218.206.50.52:443 A ecashregister.dbank.fudian-bank.com_CTC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_ecashregister_443_cmcc 0 0 0
218.206.50.52:443 A ecashregister.dbank.fudian-bank.com_CMCC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_ecashregister_443_cmcc 0 0 0
218.206.50.53:10443 A openapiabt.dbank.fudian-bank.com_CTC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_openapiabt_10443_cmcc 0 0 0
218.206.50.53:443 A openabt.dbank.fudian-bank.com_cmcc FD-YNCG-Ebank-SLB.COM /Common/cg_vs_openabt_443_cmcc 0 0 0
218.206.50.53:443 A openabt.dbank.fudian-bank.com_ctc FD-YNCG-Ebank-SLB.COM /Common/cg_vs_openabt_443_cmcc 0 0 0
218.206.50.53:10443 A openapiabt.dbank.fudian-bank.com_CMCC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_openapiabt_10443_cmcc 0 0 0
218.206.50.54:443 A maplwabt.dbank.fudian-bank.com_CTC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_maplwabt_443_cmcc 0 0 0
218.206.50.54:443 A maplwabt.dbank.fudian-bank.com_CMCC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_maplwabt_443_cmcc 0 0 0
2409:876c:502:0:0:0:1:1.9701 AAAA mapss.dbank.fudian-bank.com_CMCC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_mpaas_9701_cmcc_ipv6 0 0 0
2409:876c:502:0:0:0:1:1.9701 AAAA mapss.dbank.fudian-bank.com_CTC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_mpaas_9701_cmcc_ipv6 0 0 0
2409:876c:502:0:0:0:1:5.443 AAAA web.dbank.fudian-bank.com_CTC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_web_443_cmcc_ipv6 0 0 0
2409:876c:502:0:0:0:1:5.443 AAAA web.dbank.fudian-bank.com_CMCC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_web_443_cmcc_ipv6 0 0 0
2409:876c:502:0:0:0:1:6.443 AAAA open.dbank.fudian-bank.com_CTC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_open_443_cmcc_ipv6 0 0 0
2409:876c:502:0:0:0:1:6.443 AAAA open.dbank.fudian-bank.com_CMCC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_open_443_cmcc_ipv6 0 0 0
2409:876c:502:0:0:0:1:7.443 AAAA mall.dbank.fudian-bank.com_CMCC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_mall_443_cmcc_ipv6 0 0 0
2409:876c:502:0:0:0:1:7.443 AAAA mall.dbank.fudian-bank.com_CTC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_mall_443_cmcc_ipv6 0 0 0
2409:876c:502:0:0:0:1:8.443 AAAA mallportal.dbank.fudian-bank.com_CTC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_mallportal_443_cmcc_ipv6 0 0 0
2409:876c:502:0:0:0:1:8.443 AAAA mallportal.dbank.fudian-bank.com_CMCC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_mallportal_443_cmcc_ipv6 0 0 0
2409:876c:502:0:0:0:1:9.443 AAAA lmapi.dbank.fudian-bank.com_CMCC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_lmapi_443_cmcc_ipv6 0 0 0
2409:876c:502:0:0:0:1:9.443 AAAA lmapi.dbank.fudian-bank.com_CTC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_lmapi_443_cmcc_ipv6 0 0 0
2409:876c:502:0:0:0:1:a.443 AAAA cmw.dbank.fudian-bank.com_cmcc FD-YNCG-Ebank-SLB.COM /Common/cg_vs_cmw_443_cmcc_ipv6 0 0 0
2409:876c:502:0:0:0:1:a.443 AAAA cmw.dbank.fudian-bank.com_ctc FD-YNCG-Ebank-SLB.COM /Common/cg_vs_cmw_443_cmcc_ipv6 0 0 0
2409:876c:502:0:0:0:1:b.443 AAAA maplw.dbank.fudian-bank.com_CTC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_maplw_443_cmcc_ipv6 0 0 0
2409:876c:502:0:0:0:1:b.443 AAAA maplw.dbank.fudian-bank.com_CMCC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_maplw_443_cmcc_ipv6 0 0 0
2409:876c:502:0:0:0:1:c.443 AAAA fdxiaomi.dbank.fudian-bank.com_cmcc FD-YNCG-Ebank-SLB.COM /Common/cg_vs_fdxiaomi_443_cmcc_ipv6 0 0 0
2409:876c:502:0:0:0:1:c.443 AAAA fdxiaomi.dbank.fudian-bank.com_ctc FD-YNCG-Ebank-SLB.COM /Common/cg_vs_fdxiaomi_443_cmcc_ipv6 0 0 0
2409:876c:502:0:0:0:1:d.443 AAAA ecashregister.dbank.fudian-bank.com_CTC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_ecashregister_443_cmcc_ipv6 0 0 0
2409:876c:502:0:0:0:1:d.443 AAAA ecashregister.dbank.fudian-bank.com_CMCC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_ecashregister_443_cmcc_ipv6 0 0 0
2409:876c:502:0:0:0:1:e.10443 AAAA openapiabt.dbank.fudian-bank.com_CTC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_openapiabt_10443_cmcc_ipv6 0 0 0
2409:876c:502:0:0:0:1:e.443 AAAA openabt.dbank.fudian-bank.com_ctc FD-YNCG-Ebank-SLB.COM /Common/cg_vs_openabt_443_cmcc_ipv6 0 0 0
2409:876c:502:0:0:0:1:e.443 AAAA openabt.dbank.fudian-bank.com_cmcc FD-YNCG-Ebank-SLB.COM /Common/cg_vs_openabt_443_cmcc_ipv6 0 0 0
2409:876c:502:0:0:0:1:e.10443 AAAA openapiabt.dbank.fudian-bank.com_CMCC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_openapiabt_10443_cmcc_ipv6 0 0 0
2409:876c:502:0:0:0:1:f.443 AAAA maplwabt.dbank.fudian-bank.com_CMCC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_maplwabt_443_cmcc_ipv6 0 0 0
2409:876c:502:0:0:0:1:f.443 AAAA maplwabt.dbank.fudian-bank.com_CTC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_maplwabt_443_cmcc_ipv6 0 0 0
240e:64c:500:1:0:0:1:1.9701 AAAA mapss.dbank.fudian-bank.com_CMCC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_mpaas_9701_ctc_ipv6 0 0 0
240e:64c:500:1:0:0:1:1.9701 AAAA mapss.dbank.fudian-bank.com_CTC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_mpaas_9701_ctc_ipv6 0 0 0
240e:64c:500:1:0:0:1:5.443 AAAA web.dbank.fudian-bank.com_CTC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_web_443_ctc_ipv6 0 0 0
240e:64c:500:1:0:0:1:5.443 AAAA web.dbank.fudian-bank.com_CMCC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_web_443_ctc_ipv6 0 0 0
240e:64c:500:1:0:0:1:6.443 AAAA open.dbank.fudian-bank.com_CMCC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_open_443_ctc_ipv6 0 0 0
240e:64c:500:1:0:0:1:6.443 AAAA open.dbank.fudian-bank.com_CTC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_open_443_ctc_ipv6 0 0 0
240e:64c:500:1:0:0:1:7.443 AAAA mall.dbank.fudian-bank.com_CMCC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_mall_443_ctc_ipv6 0 0 0
240e:64c:500:1:0:0:1:7.443 AAAA mall.dbank.fudian-bank.com_CTC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_mall_443_ctc_ipv6 0 0 0
240e:64c:500:1:0:0:1:8.443 AAAA mallportal.dbank.fudian-bank.com_CTC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_mallportal_443_ctc_ipv6 0 0 0
240e:64c:500:1:0:0:1:8.443 AAAA mallportal.dbank.fudian-bank.com_CMCC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_mallportal_443_ctc_ipv6 0 0 0
240e:64c:500:1:0:0:1:9.443 AAAA lmapi.dbank.fudian-bank.com_CTC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_lmapi_443_ctc_ipv6 0 0 0
240e:64c:500:1:0:0:1:9.443 AAAA lmapi.dbank.fudian-bank.com_CMCC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_lmapi_443_ctc_ipv6 0 0 0
240e:64c:500:1:0:0:1:a.443 AAAA cmw.dbank.fudian-bank.com_cmcc FD-YNCG-Ebank-SLB.COM /Common/cg_vs_cmw_443_ctc_ipv6 0 0 0
240e:64c:500:1:0:0:1:a.443 AAAA cmw.dbank.fudian-bank.com_ctc FD-YNCG-Ebank-SLB.COM /Common/cg_vs_cmw_443_ctc_ipv6 0 0 0
240e:64c:500:1:0:0:1:b.443 AAAA maplw.dbank.fudian-bank.com_CMCC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_maplw_443_ctc_ipv6 0 0 0
240e:64c:500:1:0:0:1:b.443 AAAA maplw.dbank.fudian-bank.com_CTC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_maplw_443_ctc_ipv6 0 0 0
240e:64c:500:1:0:0:1:c.443 AAAA fdxiaomi.dbank.fudian-bank.com_cmcc FD-YNCG-Ebank-SLB.COM /Common/cg_vs_fdxiaomi_443_ctc_ipv6 0 0 0
240e:64c:500:1:0:0:1:c.443 AAAA fdxiaomi.dbank.fudian-bank.com_ctc FD-YNCG-Ebank-SLB.COM /Common/cg_vs_fdxiaomi_443_ctc_ipv6 0 0 0
240e:64c:500:1:0:0:1:d.443 AAAA ecashregister.dbank.fudian-bank.com_CTC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_ecashregister_443_ctc_ipv6 0 0 0
240e:64c:500:1:0:0:1:d.443 AAAA ecashregister.dbank.fudian-bank.com_CMCC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_ecashregister_443_ctc_ipv6 0 0 0
240e:64c:500:1:0:0:1:e.443 AAAA openabt.dbank.fudian-bank.com_ctc FD-YNCG-Ebank-SLB.COM /Common/cg_vs_openabt_443_ctc_ipv6 0 0 0
240e:64c:500:1:0:0:1:e.10443 AAAA openapiabt.dbank.fudian-bank.com_CTC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_openapiabt_10443_ctc_ipv6 0 0 0
240e:64c:500:1:0:0:1:e.443 AAAA openabt.dbank.fudian-bank.com_cmcc FD-YNCG-Ebank-SLB.COM /Common/cg_vs_openabt_443_ctc_ipv6 0 0 0
240e:64c:500:1:0:0:1:e.10443 AAAA openapiabt.dbank.fudian-bank.com_CMCC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_openapiabt_10443_ctc_ipv6 0 0 0
240e:64c:500:1:0:0:1:f.443 AAAA maplwabt.dbank.fudian-bank.com_CMCC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_maplwabt_443_ctc_ipv6 0 0 0
240e:64c:500:1:0:0:1:f.443 AAAA maplwabt.dbank.fudian-bank.com_CTC FD-YNCG-Ebank-SLB.COM /Common/cg_vs_maplwabt_443_ctc_ipv6 0 0 0"""


def _get_domain(line):
    items = line.split(' ')
    domain = items[2]
    return domain.split('_')[0]


def _parse_info(info):
    """

    Args:
        info:

    Returns:

    """
    lines = info.split('\n')
    for line in lines:
        is_ip_line = False
        ip = ''
        if is_ipv4(line):
            is_ip_line = True
            ip = get_ipv4_str(line)
            ip = ip[0]
        elif len(get_ipv6_str(line)) > 0:
            is_ip_line = True
            ip = get_ipv6_str(line)
            ip = ip[0][0]
        if is_ip_line:
            domain = _get_domain(line)
            print(ip)
            print(domain)
    pass


_parse_info(info)
